package cn.yunhe.service.impl;

import cn.yunhe.dao.DistrictDao;
import cn.yunhe.model.District;
import cn.yunhe.service.DistrictBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/*spring注解*/
@Service(value = "districtBiz")
public class DistrictBizImpl implements DistrictBiz {

    /*spring注解*/
    @Autowired
    @Qualifier("districtDao")
    DistrictDao districtDao;

    @Override
    public boolean insertDistrict(District district) {
        return districtDao.insertDistrict(district);
    }

    @Override
    public boolean updateDistrict(District district) {
        return districtDao.updateDistrict(district);
    }

    @Override
    public boolean deleteDistrict(Integer hid) {
        return districtDao.deleteDistrict(hid);
    }

    @Override
    public District getById(Integer hid){
        return districtDao.getById(hid);
    }

    @Override
    public List<District> searchDistrict(String hql) {
        return districtDao.searchDistrict(hql);
    }

    @Override
    public List<District> searchDistrict(District district) {
        return districtDao.searchDistrict(district);
    }

    public DistrictDao getDistrictDao() {
        return districtDao;
    }

    public void setDistrictDao(DistrictDao districtDao) {
        this.districtDao = districtDao;
    }
}
